(via EnkiP): fix(workflow-executor): restore field names in fetchXToOneCandidate befo#1611
Open
macroscopeapp[bot] wants to merge 1 commit into
Open
Conversation
…efore accessing relation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where relations with underscores in their names (e.g.,
customer_order) would trigger spuriousRelatedRecordNotFoundErrorwhen accessing them in the workflow executor.Changes
restoreFieldNamesinfetchXToOneCandidateafter retrieving the parent record fromagentPort.getRecordRoot Cause
The agent-client returns records with camelCase keys, but relation lookups were using the original field names (which may contain underscores). Without restoring the field names first, the relation key wouldn't match and the lookup would fail.
Note
Macroscope: Fix It For Me
Activity
Currently: Not merged: unstable
Previously
Note
Fix relation field lookup in
LoadRelatedRecordStepExecutorto handle snake_case field namesWhen resolving a related record, the parent record's values are fetched in camelCase but the relation target name uses the original schema field name (e.g., snake_case). This mismatch caused
RelatedRecordNotFoundErrorto be thrown incorrectly for any relation whose name contains underscores.The fix calls
restoreFieldNamesinload-related-record-step-executor.tsto mapparent.valuesback to original schema field names before looking uptarget.name.Risk: Each call to
resolveFromSelectionnow performs an additional async schema fetch.Macroscope summarized eb2e978.